/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package mvp.levelup.trees;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.TreeSet;
import mvp.levelup.hashs.model.Account;

/**
 *
 * @author WORKSPOT2
 */
public class TreeSetTest
{

    public static void main(String[] args)
    {
        TreeSet<Integer> set = new TreeSet<Integer>(new MyComparator());
        set.add(4);
        set.add(-9);
        set.add(6);
        set.add(14);
        set.add(53);
//        showCollection(set);

        List<PlayerRatio> ratios = new ArrayList<PlayerRatio>();
        ratios.add(new PlayerRatio(1, 100));
        ratios.add(new PlayerRatio(2, 50));
        ratios.add(new PlayerRatio(3, 60));
        ratios.add(new PlayerRatio(4, 36));
        ratios.add(new PlayerRatio(5, 500));
        PlayerRatio r = new PlayerRatio(5, 500);
        PlayerRatio r1 = new PlayerRatio(5, 500);
        System.out.println("r: "+r.hashCode());
        System.out.println("r1: "+r1.hashCode());
        TreeSet<PlayerRatio> sortedRatios = new TreeSet<PlayerRatio>(ratios);

//        showCollection(sortedRatios);
    }

    private static void showCollection(Collection collToShow)
    {
        Iterator iterAcc = collToShow.iterator();
        while (iterAcc.hasNext())
        {
            System.out.println(iterAcc.next());
        }
    }
}
